<?php
/* Description: This file is used to add sub sub category. */
#########IncludeFiles####################################################################################
include_once '../inc/config.php';
include_once("../inc/bootstrape.php");
require_once _SITE_PATH_.'classes/Vendor/Vendor.php';
require_once _SITE_PATH_.'classes/Product/Product.php';
require_once _SITE_PATH_.'classes/Category/Category.php';
require_once _SITE_PATH_.'classes/CommonUtility/CommonUtility.php';

$id = trim($_REQUEST['id']);

if( $_POST['submit']=='Submit'){   
	$parms['id'] = $_POST['id'];
    $parms['category_id'] = $_POST['category_id'];
	$parms['name'] = $_POST['name'];
	$parms['description'] = $_POST['description'];
	$parms['added'] = date("Y-m-d h:i:s");
	 
	$condition['id'] = $parms['id'];
	
    if( CommonUtility::updateData($parms, 'category_attributes', $condition)) {        
        header("Location: product_attribute_mng.php?msg=1506");            
        exit;
    }
    $err = 1507;    
}

$editor = CommonUtility::includeEditor();

$attributes = array();
$attributes = Product::getProductAttributes($id);
$result = $attributes[0];
$sub_sub_categories = array();
$sub_sub_categories = Category::getSubSubCategories($result['category_id'], 1);
$subsubcat = $sub_sub_categories[0];
    
$errMsg = $err;
$_tplName = 'product/product_attribute_edit.tpl';
$_title = 'Edit Product Attribute';

require_once _ADMIN_TPL_MAIN_;
?>